import querystring from 'querystring';

export default () => {
  const search = location.search.replace('?', '');
  const hashParams = ~location.hash.indexOf('?') ? location.hash.split('?')[1] : '';

  return {
    ...querystring.parse(hashParams), // 兼容 #/xxx/xxx?x=x的方式
    ...querystring.parse(search),
  };
}